package com.raycloud.controller;

import com.raycloud.constants.SystemConstant;
import com.raycloud.dao.EndProjectDAO;
import com.raycloud.dao.FrontProjectDAO;
import com.raycloud.dao.VersionDAO;
import com.raycloud.pojo.EndProject;
import com.raycloud.query.EndProjectQuery;
import com.raycloud.util.CmdUtil;
import com.raycloud.util.GitLabUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.text.MessageFormat;
import java.util.HashSet;
import java.util.Set;

/**
 * Created by donar on 17/4/19.
 */
@Controller
@RequestMapping("/common")
public class CommonController {
    @RequestMapping(value = "projects")
    @ResponseBody
    public Response getProjectList()  {
        return Response.success(GitLabUtils.getProjectList());
    }
    @RequestMapping(value = "branches")
    @ResponseBody
    public Response getProjectList(String id)  {
        return Response.success(GitLabUtils.getBranchList(id));
    }
}
